import ReMain from '@/components/ReMain.vue'

export const loginRouter = {
  path: '/login',
  name: 'login',
  meta: {
    title: '登录'
  },
  component: () => import('@/components/server/Login.vue')
}

export const registRouter = {
  path: '/regist',
  name: 'regist',
  meta: {
    title: '注册'
  },
  component: () => import('@/components/server/Registe.vue')
}

export const locking = {
  path: '/locking',
  name: 'locking',
  meta: {
    title: '锁屏'
  },
  component: () => import('@/components/main/LockingPage.vue')
}

export const otherRouter = {
  path: '/',
  name: 'home',
  // redirect: '/login',
  // 测试布局
  redirect: '/algon-one',
  component: ReMain,
  children: [{
    path: 'home',
    title: '首页',
    name: 'home_index',
    component: () => import('@/components/home/Home.vue')
  }, ]
}

export const AlgonOneRouter = {
  path: '/algon-one',
  name: 'algon-one',
  meta: {
    title: '布局一'
  },
  component: () => import('@/components/algorithms-center/AlgonOne.vue')
}

export const appRouter = [{
    path: '/list',
    icon: 'icon-list',
    name: 'list',
    title: '查询列表',
    component: ReMain,
    children: [{
      path: 'index',
      name: 'search-list',
      title: '查询列表',
      component: () => import('@/components/temp/SearchList.vue')
    }]
  },
  {
    path: '/g6',
    icon: 'icon-list',
    name: 'g6',
    title: 'G6-Editor',
    component: ReMain,
    children: [{
      path: 'index',
      name: 'g6editor',
      title: 'g6editor',
      component: () => import('@/components/gtest/ModelFlow.vue')
    }, {
      path: 'show',
      name: 'show',
      title: '显示解点',
      component: () => import('@/components/gtest/display.vue')
    }, {
      path: 'base',
      name: 'base',
      title: 'base',
      component: () => import('@/components/gtest/base.vue')
    }]
  }
]

export const routers = [
  otherRouter,
  locking,
  loginRouter,
  AlgonOneRouter,
  registRouter,
  ...appRouter,
]
